package jacob.id.ants;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class win extends AntProjectActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.end_game);

		Button game_win = (Button)findViewById(R.id.button1);
		Button game_new = (Button)findViewById(R.id.button2);
		boolean newGame = false;
		TextView title_win = (TextView)findViewById(R.id.textView1);
		Bundle bundle = getIntent().getExtras();
		boolean b = bundle.getBoolean("win_lose");
		if(b == true){
			title_win.setText("Congradulations! You Win");
		}
		if(b == false){
			title_win.setText("You Lost");
		}
		final Intent gameIntent = new Intent(getBaseContext(), Panel.class);
		Bundle c = new Bundle();
		c.putBoolean("New_game", true);
		gameIntent.putExtra("NewGame", c);
		final Context ctx = this;
		game_new.setOnClickListener(new OnClickListener(){
			public void onClick(View v) {
				// TODO Auto-generated method stub
				ctx.startActivity(gameIntent);
			}	
		});
		game_win.setOnClickListener(new OnClickListener(){

			public void onClick(View v) {
				// TODO Auto-generated method stub
				ctx.startActivity(gameIntent);
				System.exit(0);
			}
			
		});















	}




}

